<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>口腔圈</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="address=no"/>
<link href="__PUBLIC__/css/base.css" rel="stylesheet"/>
</head>
<body class="huibg">
<!---  头部开始  -->
<div class="top clearfix">
	<div class="icon_left"></div>
	<div class="icon_right"></div>
</div>
<!---  头部结束  -->
<div class="oral_circle cssss">
	<div class="box1 after">
		<a href="__URL__/actity_wfb_edit" class="btn btn1">我要发布活动</a>
		<div class="search_box">
			<input type="text" placeholder="请输入搜索内容" />
			<a class="search_btn1"></a>
		</div>
	</div>
	<div class="nav_box1">
		<div class="fc_click nav_li1">
			<span>专业</span>
			<i class="jiantou4"></i>
		</div>
		<div class="fc_click nav_li2">
			<span>省/直辖市</span>
			<i class="jiantou4"></i>
		</div>
	</div>
	<div class="list">
	</div>
	<a class="more">查看更多</a>
</div>
<!---  统一样式浮层开始  -->
<div class="fc_box area_box none">
	<div class="fcBox_bg"></div>
	<div class="fcBox_text">
		<dl>
			<dt>选择地区：<span class="close3" onclick="close3(this);"></span></dt>
			<dd>全国</dd>
			<volist name="area" id="vo">
				<dd>{$vo.name}</dd>
			</volist>
		</dl>
	</div>
</div>
<!---  统一样式浮层结束  -->
<!---  统一样式浮层开始  -->
<div class="fc_box major_box none">
	<div class="fcBox_bg"></div>
	<div class="fcBox_text">
		<dl>
			<dt>选择专业：<span class="close3" onclick="close3(this);"></span></dt>
			<dd>全部专业</dd>
			<volist name="major" id="vo">
				<dd>{$vo.name}</dd>
			</volist>
		</dl>
	</div>
</div>
<!---  统一样式浮层结束  -->
</body>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/comm.js"></script>
<script>
var pageSize=5;//每页多少条
var pageIndex=0;//初始化第0页
var area='';//地区,全国科室为空
var major='';//科室,全部科室为空
var key='';//搜索的内容，默认为空
var cashtype;//免费与否
var sta;//报名状态
function getlist(){
	var new_element;
	$.post('__URL__/oral_circle_page',{
		pageSize:pageSize,
		pageIndex:pageIndex,
		area:area,
		major:major,
		key:key
	},function(e){
		if(null == e){
			$(".more").text('没有数据');
			return;
		}
		if(e.length < pageSize){
			$(".more").text('已经是最后一页');
		} 
		$.each(e,function(k,v){
			//v.id,ID
			//v.image,小图片
			//v.major,专业
			//v.diagnostic,诊断
			//v.praise,点赞
			//<a>__URL__/bl_info</a>
			var num1=v.membercount-v.restnums;//报名人数
			if(v.price==0){
				cashtype="免费";
			}else{
				cashtype=v.price;
			}
			if (v.state ==1) {
				sta="报名已结束";
			}else if(v.state ==2){
				sta="报名中";
			}else if(v.state ==3){
				sta="名额已满";
			}else{
				sta="活动已结束";
			}			
			new_element='<a class="box" href="__URL__/actity_info/id/'+v.id+'">'+
				'<div class="text1">'+
					'<img src="'+v.image+'">'+
					'<div class="text">'+
						'<p class="title">'+v.name+'</p>'+
						'<p><span class="yf">'+v.major+'</span><span class="end">'+sta+'</span></p>'+
						'<p class="num2"><span>参与人数：</span><span>'+num1+'/'+v.membercount+' 人</span></p>'+
					'</div>'+
					'<span class="size">'+cashtype+'</span>'+
				'</div>'+
				'<div class="num3"><span>活动开始时间：</span><span>'+v.starttime+'</span></div>'+
				'<div class="num3"><span>活动简介：</span><span>'+v.description+'</span></div>'+
			'</a>';
			$(".list").append(new_element);
		});
		pageIndex++;//当前计数加
	});
}
getlist();
$(".more").on("click",function(){
	getlist();
});
//选择专业
$(".nav_li1").click(function(){
	$(".major_box").removeClass("none");
});
//选择地区
$(".nav_li2").click(function(){
	$(".area_box").removeClass("none");
});
//选择科室
$(".major_box dd").click(function(){
	if($(this).html()=="全部专业"){
		major="";
	}else{
		major=$(this).html();
	}	
	$(".nav_li1 span").html($(this).html());
	$(".list").html("");
	pageIndex=0;
	$(".more").text('获取更多');
	getlist();
	$(".major_box").addClass("none");
});
//选择地区
$(".area_box dd").click(function(){
	if($(this).html()=="全国"){
		area="";
	}else{
		area=$(this).html();
	}	
	$(".nav_li2 span").html($(this).html());
	$(".list").html("");
	pageIndex=0;
	$(".more").text('获取更多');
	getlist();
	$(".area_box").addClass("none");
});
//搜索
$(".search_box .search_btn1").click(function(){
	key=$(".search_box input").val();
	$(".list").html("");
	pageIndex=0;
	$(".more").text('获取更多');
	getlist();
});
</script>
</html>